function buyWater(money){
    var result;
    switch(money){
        case 2.5:
            result = "农夫山泉";
            break;
        case 3:
            result = "百事可乐";
            break;
        case 5:
            result = "红牛";
            break;
        default:
            result = "水";
    }
    return result;
}
var obj = {
    name:"跑腿小张",
    age:22,
    gender:"male",
    buyWater:buyWater
}
console.log(obj);
